package leetcode;

import java.util.ArrayList;
import java.util.List;

public class Code9_ {
    /**
     * @param n: An integer
     * @return: A list of strings.
     */
    public List<String> fizzBuzz(int n) {
        // write your code here
        List<String> list = new ArrayList<>();
        String ff="fizz";
        String fb = "buzz";
        String ffb="fizz buzz";
        for (int a=1;a<=n;a++){
            String s=""+a;
            if (a%15==0){
                s=ffb;
            }else if (a%5==0){
                s=fb;
            }else if(a%3==0){
                s=ff;
            }
            list.add(s);
        }
        return list;
    }
}
